<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Alterar Funcionario</title>
    </h:head>
    <h:body>
        <ui:include src="../menu.xhtml" />
        <div id="corpo">
            <f:view>
                <h:form>
                    <fieldset>
                        <legend>Funcionario: #{funcionarioBean.funcionario.nome}</legend>
                        <h:inputHidden value="#{funcionarioBean.funcionario.codigo}"></h:inputHidden>
                        <table>
                            <tr>
                                <td>Nome:</td>
                                <td><h:inputText size="76" value="#{funcionarioBean.funcionario.nome}"></h:inputText></td>
                            </tr>
                            <tr>
                                <td>Logradouro:</td>
                                <td>
                                    <h:inputText value="#{funcionarioBean.funcionario.logradouro}"></h:inputText>
                                </td>
                            </tr>
                            <tr>
                                <td>Cidade:</td>
                                <td>
                                    <h:inputText value="#{funcionarioBean.funcionario.cidade}"></h:inputText>
                                </td>
                            </tr>
                            <tr>
                                <td>Fone:</td>
                                <td>
                                    <h:inputText value="#{funcionarioBean.funcionario.fone}"></h:inputText>
                                </td>
                            </tr>
                             <tr>
                                <td>Email:</td>
                                <td>
                                    <h:inputText value="#{funcionarioBean.funcionario.email}"></h:inputText>
                                </td>
                            </tr>
                            <tr>
                                <td>Função:</td>
                                <td>
                                     <h:selectOneMenu
                                        value="#{funcionarioBean.funcionario.funcao.codigo}">
                                        <f:selectItems value="#{funcaoBean.listFuncao}" var="f"
                                        itemLabel="#{f.nome}"  itemValue="#{f.codigo}" />
                                    </h:selectOneMenu>
                                </td>
                            </tr>
                            <tr>
                                <td>Setor:</td>
                                <td>
                                    <h:selectOneMenu
                                        value="#{funcionarioBean.funcionario.setor.codigo}">
                                        <f:selectItems value="#{setorBean.listSetor}" var="s"
                                        itemLabel="#{s.descricao}"  itemValue="#{s.codigo}" />
                                    </h:selectOneMenu>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <h:commandButton value="Alterar" action="#{funcionarioBean.alterar}"></h:commandButton>
                                </td>
                            </tr>
                        </table>
                        <br></br>
                            <h:outputText escape="false" value="#{funcionarioBean.retornoHtml}" />  
                        
                    </fieldset>
                </h:form>
                <ui:include src="../rodape.xhtml" />
            </f:view>
        </div>
    </h:body>
</html>